package com.bjc.sdx.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.bjc.sdx.MainActivity;
import com.bjc.sdx.R;


public class Activity02 extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity02_layout);
        Button btn = (Button)findViewById(R.id.btn1);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //创建一个Intent对象，通过该对象开启第2个Activity
                Intent intent=new Intent(Activity02.this, MainActivity.class);
                startActivity(intent);
            }
        });
        Log.i("Activity02","onCreate()");
    }
    @Override
    protected void onStart() {
        super.onStart();
        Log.i("Activity02","onStart()");
    }
    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i("Activity02","onRestart()");
    }
    @Override
    protected void onResume() {
        super.onResume();
        Log.i("Activity02","onResume()");
    }
    @Override
    protected void onPause() {
        super.onPause();
        Log.i("Activity02","onPause()");
    }
    @Override
    protected void onStop() {
        super.onStop();
        Log.i("Activity02","onStop()");
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i("Activity02","onDestroy()");
    }

}